package com.example.weather;

import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;

/**
 * Created by asd on 2016/9/14.
 */
public class Fragment3 extends Fragment implements View.OnClickListener {
    private ImageView ivPhone;
    private ImageView ivQQ;
    private LinearLayout llGongGao;
    private LinearLayout llShengHuoQuan;
    private LinearLayout llHuoDongZhongXin;
    private LinearLayout llPiFuXiaoZhen;
    private LinearLayout llGeXingZhuShou;
    private LinearLayout llMoJiShangCheng;
    private LinearLayout llKongQiGuo;
    private LinearLayout llSheZhi;
    private LinearLayout llQingLiHuanCun;


    private View view;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment2, null);
        init();
        setListener();
        return view;
    }

    private void setListener() {
        ivPhone.setOnClickListener(this);
        ivQQ.setOnClickListener(this);
        llGongGao.setOnClickListener(this);
        llShengHuoQuan.setOnClickListener(this);
        llHuoDongZhongXin.setOnClickListener(this);
        llPiFuXiaoZhen.setOnClickListener(this);
        llGeXingZhuShou.setOnClickListener(this);
        llMoJiShangCheng.setOnClickListener(this);
        llKongQiGuo.setOnClickListener(this);
        llSheZhi.setOnClickListener(this);
        llQingLiHuanCun.setOnClickListener(this);

    }

    private void init() {
        ivPhone = (ImageView) view.findViewById(R.id.iv_phone);
        ivQQ = (ImageView) view.findViewById(R.id.iv_QQ);
        llGongGao = (LinearLayout) view.findViewById(R.id.ll_gongGao);
        llShengHuoQuan = (LinearLayout) view.findViewById(R.id.ll_shengHuoQuan);
        llHuoDongZhongXin = (LinearLayout) view.findViewById(R.id.ll_huoDongZhongXin);
        llPiFuXiaoZhen = (LinearLayout) view.findViewById(R.id.ll_piFuXiaoZhen);
        llGeXingZhuShou = (LinearLayout) view.findViewById(R.id.ll_geXingZhuShou);
        llMoJiShangCheng = (LinearLayout) view.findViewById(R.id.ll_moJiShangCheng);
        llKongQiGuo = (LinearLayout) view.findViewById(R.id.ll_kongQiGuo);
        llSheZhi = (LinearLayout) view.findViewById(R.id.ll_SheZhi);
        llQingLiHuanCun = (LinearLayout) view.findViewById(R.id.ll_qingLiHuanCun);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_phone:

                break;
            case R.id.iv_QQ:

                break;
            case R.id.ll_gongGao:
                Intent intent = new Intent(getActivity(), GongGao.class);
                startActivity(intent);
                break;
            case R.id.ll_shengHuoQuan:
                Intent intent1 = new Intent(getActivity(), ShengHuoQuan.class);
                startActivity(intent1);
                break;
            case R.id.ll_huoDongZhongXin:
                Intent intent2 = new Intent(getActivity(), HuoDongZhongXin.class);
                startActivity(intent2);
                break;
            case R.id.ll_piFuXiaoZhen:
                break;
            case R.id.ll_geXingZhuShou:
                break;
            case R.id.ll_moJiShangCheng:
                Intent intent3 = new Intent(getActivity(), moJiShangCheng.class);
                startActivity(intent3);
                break;
            case R.id.ll_kongQiGuo:
                Intent intent4 = new Intent(getActivity(), kongQiGuo.class);
                startActivity(intent4);
                break;
            case R.id.ll_SheZhi:
                break;
            case R.id.ll_qingLiHuanCun:

                break;
        }
    }
}
